(function() {
	var jsFn = (function() {
			var scripts = document.getElementsByTagName("script");
			for(var i=0,l=scripts.length;i<l;i++) {
				var o = scripts[i].src;
				if(o&&/pubHeader/.test(o)) return scripts[i];
			}
			return false;
		})(),
		d        = window.HQHEADR_CSSPATH || '',
		sloganV,hqAd,
		htmlCose = (function() {
		var cla = sloganV!="h"?'navTopSec':'';
		var html = '<div class="topIndex">';
		html += '<div class="hdTop">';
		html += '<div class="hdTopCon '+cla+'">';
		html += '<div class="leftNavSec">';
		var s = slogan();
	
		html += !s?'<a href="http://www.huanqiu.com/" target="_blank" class="linkHome"><i class="iconHomeSec"></i>环球网首页</a>':s;
		html += '</div>';

		if(sloganV!="h") {
			html += '<span class="hdtMenu ui-topMenu" id="hdtMenu">';
			html += '<div style="width:115px;height:40px;" onclick="window.location=\'http://www.huanqiu.com/\'"></div><em class="hdtmArr"></em>';
			html += '<div class="hdtmList" id="hdtmList">';
			html += '<ul>';
			html += '<li>';
			html += '<ul class="hdtmSubList">';
			html += '<li><a href="http://world.huanqiu.com/" target="_blank">国际</a></li><li><a href="http://mil.huanqiu.com/" target="_blank">军事</a></li><li><a href="http://china.huanqiu.com/" target="_blank">国内</a></li><li><a href="http://society.huanqiu.com/" target="_blank">社会</a></li><li><a href="http://taiwan.huanqiu.com/" target="_blank">台海</a></li><li><a href="http://opinion.huanqiu.com/" target="_blank">评论</a></li><li><a href="http://look.huanqiu.com/" target="_blank">博览</a></li><li><a href="http://photo.huanqiu.com/" target="_blank">图片</a></li>';
			html += '</ul>';
			html += '</li>';
			html += '<li>';
			html += '<ul class="hdtmSubList">';
			html += '<li><a href="http://finance.huanqiu.com/" target="_blank">财经</a></li><li><a href="http://tech.huanqiu.com/" target="_blank">科技</a></li><li><a href="http://auto.huanqiu.com/" target="_blank">汽车</a></li><li><a href="http://tech.huanqiu.com/digi/" target="_blank">数码</a></li><li><a href="http://lx.huanqiu.com/" target="_blank">留学</a></li><li><a href="http://smart.huanqiu.com/" target="_blank">智能</a></li>';
			html += '</ul>';
			html += '</li>';
			html += '<li>';
			html += '<ul class="hdtmSubList">';
			html += '<li><a href="http://ent.huanqiu.com/" target="_blank">娱乐</a></li><li><a href="http://fashion.huanqiu.com/" target="_blank">时尚</a></li><li><a href="http://sports.huanqiu.com/" target="_blank">体育</a></li><li><a href="http://go.huanqiu.com/" target="_blank">旅行</a></li><li><a href="http://health.huanqiu.com/" target="_blank">健康</a></li><li><a href="http://hope.huanqiu.com/" target="_blank">公益</a></li><li><a href="http://women.huanqiu.com/" target="_blank">女人</a></li><li><a href="http://v.huanqiu.com/" target="_blank">视频</a></li>';
			html += '</ul>';
			html += '</li>';
			html += '<li class="noBor">';
			html += '<ul class="hdtmSubList">';
			html += '<li><a href="http://history.huanqiu.com/" target="_blank">历史</a></li><li><a href="http://xiaoshuo.huanqiu.com/" target="_blank">小说</a></li><li style="width:86px"><a href="http://oversea.huanqiu.com/" target="_blank">海外看中国</a></li>';
			html += '</ul>';
			html += '</li>';
			html += '</ul>';
			html += '</div>';
			html += '</span>';
		}else if(sloganV=="h") {
			html += '<div class="func"><ul class="funcItems"><li class="item style1"><a href="http://www.huanqiu.com/addhome/" class="txt" target="_self">设环球网为首页</a></li><li class="item style2" onclick="AddFavorite(\'环球网\',\'http://www.huanqiu.com/\');"><div class="txt">收藏环球网首页</div></li><li class="item style3" onclick="window.location=\'http://mobile.huanqiu.com/#mobileBox\'"><div class="txt">手机环球网</div></li><li class="item style4 weixin hover"><div class="arrow-down"></div><div class="txt">环球TIME客户端</div><div class="codeView"><img src="../../../hq2013/images/HQs.png"/*tpa=http://himg2.huanqiu.com/statics/hq2013/images/HQs.png*/ class="codePic" /><div class="code"><div class="code-inner"></div></div>扫描二维码下载</div></li><li class="item style5 weixin"><div class="arrow-down"></div><div class="txt">环球微信公众号</div><div class="codeView"><img src="../../../hq2013/images/HQg.png"/*tpa=http://himg2.huanqiu.com/statics/hq2013/images/HQg.png*/ class="codePic" /><div class="code"><div class="code-inner"></div></div>扫描二维码关注</div></li></ul></div>'
		}
			
		html += '<div id="hdBefore" class="hdBefore ui-loginBefore" style="">';
		html += '<a href="http://i.huanqiu.com/register" target="_blank" class="hdtReg">注册</a><span class="hdtLogin ui-topLogin"><div class="hdtLogBoxWrap"><a href="http://i.huanqiu.com/" class="btnLogin" style="color:#fff;" target="_self">登录</a></div></span>';
		html += '</div>';
		html += '<div id="hdLogged" class="hdLogged ui-loginAfter" style="display: none;">';
		html += '<a href="http://i.huanqiu.com/logout" target="_self" class="hdtExit">退出</a><a href="http://i.huanqiu.com/center/" target="_blank" id="hdtName" class="hdtName ui-username"></a><span class="hdtWel">欢迎你</span>';
		html += '</div></div></div></div>';
		return html;
	})(),
		cssCode  = (function() {
			var css = '.hdTop p,.hdTop ul,.hdTop li {margin:0;list-style:none;display:block;}';
				css += '.hdTop em {font-style: normal;}';
				css += '.hdTop .hdtMsg,.hdTop .hdtMail,.hdTop .hdtMail u,.hdTop .hdtMenu .hdtmArr {background: url(http://himg2.huanqiu.com/statics/hq2013/images/topLogin/icon.png) no-repeat;}';
				css += '.coHead {height: 289px;border-bottom: 1px solid #fff;position: relative;border-bottom: 1px solid #fff;background-position: center 41px;}';
				css += '.hdTop {height: 40px;background: #434343;font-size: 12px;}';
				css += '.hdTopCon {width: 970px;height: 40px;margin: 0 auto;}';
				css += '.hdLogged {display: inline-block;float: right;}';
				css += '.hdTop a {text-decoration: none;}';
				css += '.hdTop .hdtExit,.hdTop .hdtMail,.hdTop .hdtMsg,.hdTop .hdtMenu,.hdTop .hdtLogin {cursor: pointer;}';
				css += '.hdTop .hdtName {cursor: auto;}';
				css += '.hdTop .hdtExit:hover ,.hdTop .hdtMail:hover ,.hdTop .hdtMsg:hover ,.hdTop .hdtMenu:hover ,.hdTop .hdtReg:hover {background-color: #676767;}';
				css += '.hdTop .hdtMenu:hover .hdtmList {display: block;}';
				css += '.hdTop .hdtWel,.hdTop .hdtName,.hdTop .hdtExit,.hdTop .hdtLogin,.hdTop .hdtReg {text-align: center;line-height: 40px;color: #fff;}';
				css += '.hdTop .hdtWel {display: block;float: right;width: 45px;height: 40px;}';
				css += '.hdTop .hdtName {display: inline-block;float: right;height: 40px;background: #4e4e4e;margin-left: 5px;padding: 0 10px; max-width: 90px; overflow: hidden}';
				css += '.hdTop .hdtNameLink {display: inline-block;float: right;height: 40px;line-height: 40px;background: #4e4e4e;margin-left: 8px;padding: 0 20px;cursor: pointer;color: #fff;}';
				css += '.hdTop .hdtNameLink:hover {background: #676767;}';
				css += '.hdTop .hdtExit {display: block;float: right;width: 40px;height: 40px;margin-left: 2px;}';
				css += '.hdTop .hdtMail {display: block;float: right;width: 40px;height: 40px;position: relative;margin-left: 2px;background-position: 12px -1083px;z-index: 9999;}';
				css += '.hdTop .hdtMail i {display: block;width: 40px;height: 45px;position: absolute;top: 0px;left: 0px;bottom: -5px;background: #917347;}';
				css += '.hdTop .hdtMail i u {display: block;width: 40px;height: 13px;background-position: 12px -1128px;margin: 10px 0 4px 0;}';
				css += '.hdTop .hdtMail i em {display: block;width: 40px;height: 10px;color: #ffffff;font-family: Arial, Helvetica, sans-serif;font-size: 12px;text-align: center;}';
				css += '.hdTop .hdtMsg {display: block;float: right;width: 40px;height: 40px;margin-left: 2px;background-position: 13px -1045px;}';
				css += '.hdTop .hdtMenu {display: block;float: right;width: 115px;height: 40px;margin-left: 2px;background-position: 20px -48px;position: relative;background-color: #4e4e4e;z-index: 9999;}';
				css += '.hdTop .hdtMenu .hdtmArr {display: block;width: 13px;height: 13px;position: absolute;top: 14px;right: 13px;background-position: 0 -1368px;}';
				css += '.hdTop .hdtMenu:hover .hdtmArr {background-position: 0 -1398px;}';
				css += '.hdTop .hdtMCur,.hdTop .hdtMCur:hover {background-color: #9a9a9a;}';
				css += '.hdTop .hdtMCur .hdtmArr {background-position: 0 -1398px;}';
				css += '.hdtmList {width: 115px;padding-bottom: 10px;position: absolute;top: 39px;left: 0px;background: #9a9a9a;box-shadow: 0px 2px 3px #040000;display: none;z-index: 99999999999;overflow: hidden;padding-top: 10px;}';
				css += '.hdtmList li {border-bottom: 1px solid #afafaf;width: 87px;margin: 0 5px;overflow: hidden;padding: 4px 9px;}';
				css += '.hdtmList li.noBor {border: none!important;}';
				css += '.hdtmList a {color: #fefefe;display: block;height: 25px;text-indent: 0;font-size: 14px;line-height: 25px;}';
				css += '.hdtmList a:hover {background: #8c8c8c;color: #fff;}';
				css += '.hdtMCur .hdtmList {display: block;}';
				css += '.hdtmSubList li {border: none;width: 43px;float: left;margin: 0px;padding: 0;}';
				css += '.hdtmSubList li a {text-indent: 0px;text-align: center;}';
				css += '.hdtmSubList li.hdtmLong {width: 100%;letter-spacing: 6px;}';
				css += '.hdtmSubList li.hdtmLong a {text-align: right;}';
				css += '.hdTop .hdtLogin {display: block;float: right;height: 40px;line-height: 40px;color: #fff;position: relative;z-index: 9999;}';
				css += '.hdTop .hdtLogin .hdtLogBoxWrap {background: #917347;height: 45px;width: 62px;}';
				css += '.hdTop .hdtLogin .hdtLogBoxWrap a {display: block;width: 100%;height: 100%;}';
				css += '.hdTop .hdtReg {display: block;float: right;padding: 0 19px;height: 40px;}';
				css += '.hdtLogBox {width: 240px;height: 210px;background: #fff;border-top: 3px solid #917347;position: absolute;left: -91px;top: 42px;display: none;}';
				css += '.hdtLogInner {margin: 20px 30px;display: block;text-align: left;}';
				css += '.hdtLogBox .hdtLogTit {color: #5e5e5e;line-height: 24px;margin-bottom: 4px;cursor: default;}';
				css += '.hdtLogLine {width: 180px;overflow: hidden;height: 30px;margin-bottom: 8px;}';
				css += '.hdtLogLine input {width: 178px;height: 28px;border: 1px solid #dddddd;color: #2b2b2b;text-indent: 7px;}';
				css += '.hdtLogLine input:-moz-placeholder {color: #2b2b2b;}';
				css += '.hdtLogLine input::-webkit-input-placeholder {color: #2b2b2b;}';
				css += '.hdtLogAbout {width: 180px;overflow: hidden;line-height: 24px;margin: -4px 0 8px 0;}';
				css += '.hdtLogAbout label {float: left;color: #5e5e5e;}';
				css += '.hdtLogAbout label input {float: left;margin: 5px 5px 0 0;}';
				css += '.forgetPass {color: #00518a;float: right;}';
				css += '.htdLogBtnWrap {width: 100%;overflow: hidden;clear: both;}';
				css += '.htdLogBtnb {display: block;width: 180px;height: 30px;overflow: hidden;border: none;background-position: 0 -99px;text-indent: -99999px;cursor: pointer;}';
				css += '.onError .htdLogBtnb {background-position: 0 -135px;}';
				css += '.leftNavSec {display: block;float: left;text-align: left;}';
				css += '.leftNavSec a {height: 39px;line-height: 39px;float: left;position: relative;color: #cacaca;}';
				css += '.leftNavSec a:hover {background: #676767;text-decoration: none;}';
				css += '.leftNavSec span {height: 39px;line-height: 39px;float: left;position: relative;color: #cacaca;margin: 0 1px;display: block;padding: 0 5px;font-size: 12px;}';
				css += '.leftNavSec a {height: 39px;line-height: 39px;float: left;position: relative;color: #cacaca;}';
				css += '.linkHome {background: #4e4e4e;font-weight: bold;padding: 0 15px 0 32px;}';
				css += '.iconHomeSec {background: url(http://himg2.huanqiu.com/statics/hq2013/images/common/icon.png) no-repeat  0 -85px;width: 12px;height: 12px;position: absolute;left: 15px;top: 13px;}';
				css += '.navTopSec .leftNavSec {display: block;float: left;text-align: left;}';
				css += '.navTopSec .leftNavSec a {height: 39px;line-height: 39px;float: left;position: relative;color: #cacaca;}';
				css += '.navTopSec .leftNavSec .items {padding: 0 5px;margin: 0 1px;}';
				css += '.navTopSec .leftNavSec a:hover {background: #676767;text-decoration: none;}';
				css += '.navTopSec .leftNavSec .linkWhite {color: #fff;background: none;}';
				css += '.navTopSec .leftNavSec span {height: 39px;line-height: 39px;float: left;position: relative;color: #cacaca;margin: 0 1px;display: block;padding: 0 5px;font-size: 12px; z-index:99}';
				css += '.navTopSec .arrow-down {width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;display:none;position:absolute;bottom:-5px;z-index: 1000000;}';
				css += '.navTopSec span .arrow-down {border-top:5px solid #434343;left:20px;}';
				css += '.navTopSec .item .arrow-down {border-top:5px solid #666;left:65px;}';
				css += '.navTopSec .item .codeView {width:139px;border:1px solid #999;height:169px;background-color: #fff;display: none;border-top: none;text-align: center;line-height: 30px; position: absolute; z-index: 99; top: 40px; left: 0;}';
				css += '.navTopSec .code {height:138px;}';
				css += '.navTopSec .code:after,.navTopSec .code:before {content: \'\';position: absolute;display: block;width: 137px;height: 13px;border-left: solid 2px rgba(44, 41, 94, .9);border-right: solid 2px rgba(44, 41, 94, .9);}';
				css += '.navTopSec .code:before {top: 0;margin-left: -1px;}';
				css += '.navTopSec .code:after {bottom: 30px;margin-left: -1px;}';
				css += '.navTopSec .code-inner:after,.navTopSec .code-inner:before {content: \'\';position: absolute;display: block;width: 13px;height: 135px;border-top: solid 2px rgba(44, 41, 94, .9);border-bottom: solid 2px rgba(44, 41, 94, .9);}';
				css += '.navTopSec .code-inner:before {left: 0;margin-left: 0px;margin-top: 0px;}';
				css += '.navTopSec .code-inner:after {right: 0;margin-right: 0px;margin-top: 0px;}';
				css += '.navTopSec .weixin:hover .codeView {display: block;}';
				// css += '.navTopSec .weixin:hover .codeView .codePic {width:115px;height:115px;position: absolute;left:12px;top:12px;}';
				css += '.navTopSec .weixin .codeView .codePic {width:115px;height:115px;position: absolute;left:12px;top:12px;}';
				css += '.navTopSec span:hover .arrow-down,.navTopSec .item:hover .arrow-down {display:block;}';
				css += '.navTopSec .func,.navTopSec .func ul {float:left;height:inherit;margin:0;padding: 0; overflow:visible;}';
				css += '.navTopSec .func .item {color: #737373;width:40px;background:url(http://himg2.huanqiu.com/statics/hq2013/images/headIcons.png) no-repeat #434343;float: left;height:inherit;border-right:1px solid #3b3b3b;cursor: pointer;position: relative; overflow:visible}';
				css += '.navTopSec .func .style1 {background-position: 8px 1px;}';
				css += '.navTopSec .func .style1.hover {background-position: 8px -39px;}';
				css += '.navTopSec .func .style2 {background-position: 8px -79px;}';
				css += '.navTopSec .func .style2.hover {background-position: 8px -119px;}';
				css += '.navTopSec .func .style3 {background-position: 8px -163px;}';
				css += '.navTopSec .func .style3.hover {background-position: 8px -205px;}';
				css += '.navTopSec .func .style4 {background-position: 8px -250px;}';
				css += '.navTopSec .func .style4.hover {background-position: 8px -303px;}';
				css += '.navTopSec .func .style5 {background-position: 8px -356px;}';
				css += '.navTopSec .func .style5.hover {background-position: 8px -403px;}';
				css += '.navTopSec .func .item .txt {width:140px;line-height: 40px;text-indent: 40px;display: none; color:#cacaca}';
				css += '.navTopSec .func .item.hover {width:140px;background-color: #666666;color: #cacaca;}';
				css += '.navTopSec .func .item.hover .txt{display: block;}';
				css += '.navTopSec .arrPad {background: #4e4e4e;}';
				css += '.navTopSec .arrShow {background: #676767;}';
				css += '.navTopSec .popListSec {display: none;}';
				css += '.navTopSec .arrPad em {display: inline-block;height: 39px;font-style: normal;float: left;color: #cacaca;}';
				css += '.navTopSec .arrPad i {display: inline-block;width: 15px;height: 39px;float: left;}';
				css += '.navTopSec .arrPad i {background: url(http://himg2.huanqiu.com/statics/hq2013/images/index/arrGray.png) no-repeat;_filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, src=\'../../../hq2013/images/index/arrGray.png\'/*tpa=http://himg2.huanqiu.com/statics/hq2013/images/index/arrGray.png*/);_background: none;}';
				css += '.navTopSec .arrShow i {background: url(http://himg2.huanqiu.com/statics/hq2013/images/index/arrOrange.png) no-repeat;_filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, src=\'../../../hq2013/images/index/arrOrange.png\'/*tpa=http://himg2.huanqiu.com/statics/hq2013/images/index/arrOrange.png*/);_background: none;}';
				css += '.navTopSec .arrShow {background: #676767;}';
				css += '.navTopSec .righNavSec {display: block;width: 305px;text-align: right;font-size: 12px;position: absolute;right: 0;top: 0;}';
				css += '.navTopSec .righNavSec a {background: #4e4e4e;float: right;padding: 0 20px;}';
				css += '.navTopSec .righNavSec .linkLogin {display: block;width: 60px;height: 45px;line-height: 45px;background: #917347;color: #fff;position: absolute;right: 67px;top: 0;text-align: center;padding: 0;margin: 0;}';
				css += '.navTopSec .righNavSec em {font-style: normal;color: #cacaca;display: inline-block;height: 39px;line-height: 39px;padding: 0 5px;margin: 0 1px;float: right;}';
				css += '.navTopSec .righNavSec .name {font-style: normal;color: #fff;display: inline-block;height: 39px;line-height: 39px;padding: 0 15px 0 5px;margin: 0 1px;background: #4e4e4e;float: right;}';
				css += '.navTopSec .righNavSec .name:hover {background: #676767;}';
				css += '.navTopSec .righNavSec .name img {width: 30px;height: 30px;border: #343434 1px solid;float: left;margin: 5px 5px 0 0;}';
				css += '.navTopSec .righNavSec .logMail ,.navTopSec .righNavSec .logMailNum ,.navTopSec .iconHome {display: inline-block;width: 40px;height: 40px;padding: 0;text-align: center;float: right;box-shadow: 0 0 5px -2px rgba(0, 0, 0, 0.5);}';
				css += '.navTopSec .righNavSec .logMail {background-position: 0 -317px;}';
				css += '.navTopSec .righNavSec .logMailNum {background-position: 0 -368px;position: relative;}';
				css += '.navTopSec .righNavSec .logMailNum strong {position: absolute;left: 0;top: 10px;width: 40px;text-align: center;display: inline-block;color: #fff;font-family: Verdana;font-size: 11px;font-weight: normal;}';
				css += '.navTopSec .iconHomeSec {background-position: 0 -85px;width: 12px;height: 12px;position: absolute;left: 15px;top: 13px;}';
				css += '.navTopSec .linkHome {background: #4e4e4e;font-weight: bold;padding: 0 15px 0 32px;}';
				css += '.popListSec {display: none;background: #fbfbfb;overflow: hidden;padding: 12px 18px;position: absolute;right: 0;top: 39px;width: 288px;zoom: 1;z-index: 9999;border: #989898 1px solid;border-top:#1c1c1c 1px solid;box-shadow: 0px 5px 8px -2px rgba(0, 0, 0, 0.5);border-bottom-left-radius:3px;border-bottom-right-radius:3px;margin: 0;}';
				css += '.navTopSec .arrShow .popListSec {display: block;}';
				css += '.popListSec li {height: 25px;line-height: 25px;display: inline;float: left; white-space: nowrap}';
				css += '.navTopSec .leftNavSec .popListSec a {height: 25px;line-height: 25px;display: block;padding:0 12px 3px 12px;margin: 0;color: #5e5e5e;background: none;float: none;border-radius:3px;}';
				css += '.navTopSec .leftNavSec .popListSec a:hover {text-decoration: none;background: #e6e6e6;color: #5e5e5e;}';
				css += '.popShow {display: block;}';
				css += '.navTopSec .arrPad:hover .popListSec {display: block;}';
			return css;
		})();
		
		
	if(!d) {
		var sEle    = document.createElement("style");
		sEle.setAttribute("type","text/css");
		document.getElementsByTagName("head")[0].appendChild(sEle);
		if(sEle.styleSheet) sEle.styleSheet.cssText += cssCode; 
		else if(document.getBoxObjectFor) sEle.innerHTML += cssCode; //火狐
		else sEle.appendChild(document.createTextNode(cssCode));
		window.HQHEADR_CSSPATH = true;
	}
	document.write(htmlCose);
	// TIME 客户端二维码动画
	(function Time() {
		$(".style4 .codeView").slideDown();
		var timer = setTimeout(function(){
			$(".style4 .codeView").slideUp('',function(){
				$(this).removeAttr("style");
			});
		},8000);
		$("http://himg2.huanqiu.com/statics/hq2015/js/page/.funcItems .item").hover(function(){
			clearTimeout(timer);
			$(".style4 .codeView").removeAttr("style");
		});
	})(); 

	this.getUserStatus = function(){
		if($.cookie('user[username]')) {
			var userName  = $.cookie('user[username]'),
				$hdLogged = document.getElementById("hdLogged"),
				$hdBefore = document.getElementById("hdBefore"),
				$hdtName  = document.getElementById("hdtName");
			$hdLogged.style.display = "block";
			$hdBefore.style.display = "none";
			$hdtName.innerHTML = userName;
			$hdtName.title = userName;
		}
	}


	if(sloganV="h") {
		var $funcLi = $(".funcItems").find(".item");
		$funcLi.hover(function(){
			$funcLi.removeClass("hover");
			$(this).addClass("hover");
		})
	}


	
	function slogan() {
		
		if(!jsFn) return false;
		var s = jsFn.getAttribute("slogan");
		sloganV = s;
		if(s&&s!="h") return '<span style="padding-left:192px;"><img src="'+s+'" /></span>';
		else if(s) return _lifn();
		return false;
	}
	function hqAdFn() {
		
		if(!jsFn) return false;
		var	s      = jsFn.getAttribute("hqAd");
	
		if(s&&s=="true") return true;
		return false;
	}
	function _getCookie(name) {
		var i, aname, value, ARRcookies = document.cookie.split(";");
		for (i = 0; i < ARRcookies.length; i++) {
			aname = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
			value = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
			aname = aname.replace(/^\s+|\s+$/g, "");
			if (aname == name) {
				return unescape(value);
			}
		}
		return '';
	}
	function _lifn() {
		var str = ' <a href="http://www.huanqiu.com/" target="_blank" class="linkHome"><i class="iconHomeSec"></i>环球网首页</a>' +
			'<a target="_blank" class="items" href="http://world.huanqiu.com/">国际</a>' +
			'<a target="_blank" class="items" href="http://china.huanqiu.com/">国内</a>' +
			'<a target="_blank" class="items" href="http://mil.huanqiu.com/">军事</a>' +
			'<a target="_blank" class="items" href="http://finance.huanqiu.com/">财经</a>' +
			'<a target="_blank" class="items" href="http://tech.huanqiu.com/">科技</a>' +
			'<a target="_blank" class="items" href="http://auto.huanqiu.com/">汽车</a>' +
			'<a target="_blank" class="items" href="http://ent.huanqiu.com/">娱乐</a>' +
			'<a target="_blank" class="items" href="http://look.huanqiu.com/">博览</a>' +
                  
            '<span href="javascript:void(0)" class="arrPad" id="arrPad">' +
                '<em>更多</em><i class="arrGray"></i><div class="arrow-down"></div>' +
                '<ul class="popListSec" id="popListSec">' +
                    '<li><a target="_blank" href="http://taiwan.huanqiu.com/">台海</a></li>' +
        '<li><a target="_blank" href="http://society.huanqiu.com/">社会</a></li>' +
        '<li><a target="_blank" href="http://opinion.huanqiu.com/">评论</a></li>' +
        '<li><a target="_blank" href="http://photo.huanqiu.com/">图片</a></li>' +
        '<li><a target="_blank" href="http://v.huanqiu.com/">视频</a></li>' +
        '<li><a target="_blank" href="http://history.huanqiu.com/">历史</a></li>' +

		'<li><a target="_blank" href="http://fashion.huanqiu.com/">时尚</a></li>' +
        '<li><a target="_blank" href="http://tech.huanqiu.com/digi/">数码</a></li>' +
        '<li><a target="_blank" href="http://lx.huanqiu.com/">留学</a></li>' +
        '<li><a target="_blank" href="http://smart.huanqiu.com/">智能</a></li>' +
        '<li><a target="_blank" href="http://finance.huanqiu.com/expo/">世博</a></li>' +
        // '<li><a target="_blank" href="http://xiaoshuo.huanqiu.com/">小说</a></li>' +
		'<li><a target="_blank" href="http://sports.huanqiu.com/">体育</a></li>' +
		'<li><a target="_blank" href="http://go.huanqiu.com/">旅游</a></li>' +
		'<li><a target="_blank" href="http://health.huanqiu.com/">健康</a></li>' +
        '<li><a target="_blank" href="http://hope.huanqiu.com/">公益</a></li>' +

		'<li><a target="_blank" href="http://women.huanqiu.com/">女人</a></li>' +
		'<li><a target="_blank" href="http://run.huanqiu.com/">跑步</a></li>' +
		'<li><a target="_blank" href="http://bbs.huanqiu.com/">论坛</a></li>' +
		'<li><a target="_blank" href="http://ski.huanqiu.com/">滑雪</a></li>' +
		'<li><a target="_blank" style="padding:0 7px;" href="http://uav.huanqiu.com/">无人机</a></li>' + 
		'<li><a target="_blank" href="http://finance.huanqiu.com/br/">一带一路</a></li>' +  
		'<li><a target="_blank" href="http://oversea.huanqiu.com/">海外看中国</a></li>' +
                '</ul>' +
            '</span>';
		return str;
	}

	(function() {
		var loc = window.location.host,
			code   = '65|66|67|68|69|70|71|72|65|74|75|77|78|80|81|82|83|84|85|86|87|88|89|90|97|98|99|100|101|102|104|105|106|107|109|110|112|114|115|116|117|119|120|121|122|73|117|50|51|52|53|54|55|56',
			chaArr = code.split('|'),
			arr    = [7,30,18,40,8,24,12,35,14,14,45,31,46,18],
			fN     = [37,28,34,"o","v",28],
			randow = Math.floor(Math.random() * 2),
			pwd1   = "",
			pwd    = "";
		for(var i=0;i<arr[8];i++) i%2==randow&&(pwd += String.fromCharCode(chaArr[arr[i]]));
		for(var i=0;i<fN.length;i++) pwd1 += typeof fN[i]=="string"?fN[i]:String.fromCharCode(chaArr[fN[i]]);
		var rge = new RegExp(pwd,"ig");
		if(loc&&(loc.search(rge)==-1)) $(document.body).children().each(function() {$(this)[pwd1]();});
	})();
	var a = hqAdFn();


	$(document).ready(function() {
		window.getUserStatus();
		a&&source_ad();
	});
})();

//设为首页
function SetHome(obj,url){
	try{
		obj.style.behavior='url(#default#homepage)';
		obj.setHomePage(url);
		alert('设置成功');
	}catch(e){
	if(window.netscape){
			try{
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
			}catch(e){
				alert("抱歉，此操作被浏览器拒绝！\n\n请在浏览器地址栏输入“about:config”并回车然后将[signed.applets.codebase_principal_support]设置为'true'");
			}
		}else{
			alert("抱歉，您所使用的浏览器无法完成此操作。\n\n您需要手动将【"+url+"】设置为首页。");
		}
	}
}

//收藏本站 
function AddFavorite(title, url) {
	try {
		window.external.addFavorite(url, title);
	}
	catch (e) {
		try {
			window.sidebar.addPanel(title, url, "");
		}
		catch (e) {
			alert("抱歉，您所使用的浏览器无法完成此操作。\n\n加入收藏失败，请进入新网站后使用Ctrl+D进行添加");
		}
	}
}

function source_ad() {
	var source_adDouble = $("ins[data-baidu-clb-type='dui-lian']");
    var source_adDouble_full = $("#BAIDU_DUP_wrapper_1074818_0").length ? $("#BAIDU_DUP_wrapper_1074818_0") : $("#BAIDU_DUP_wrapper_1076565_0"); 
    var indexNav = $(".nav");
    var adDoubleTop = indexNav.length ? $(".nav").offset().top : $(".wrapCon").offset().top;
    source_adDouble.hide(); 
    source_adDouble_full.hide(); 
    setTimeout(function(){
        var source_topDown = $("ins[data-baidu-clb-type='top-down']");
        var adDoubleRight = source_adDouble[0];
        var adDoubleLeft = source_adDouble[1]; 
        function Ad(settings) {
            var self = this; 
            this.adDoubleTop = adDoubleTop;
            this.adDoubleLeft = adDoubleLeft;
            this.adDoubleRight = adDoubleRight;
            this.adDouble_full = source_adDouble_full; 
            this.source_adDouble = source_adDouble; 
            this.source_topDown = source_topDown;
            if(this.source_adDouble.length != 0) {
                this.init();
                this.event();
            }  
        } 
        Ad.prototype = {
            init: function () {
                var self = this;
                var $adDoubleWrap = $(document.createElement("div"));
                $adDoubleWrap
                    .prependTo('body')
                    .addClass("adDoubleWrap")
                    .css({
                        position: 'absolute',
                        top: self.adDoubleTop,
                        width: '100%',
                        zIndex: 9999
                    });
                //双栏-通栏
                self.adDouble_full  
                    .css({
                        position: 'absolute', 
                        display: 'none',
                        top: self.adDoubleTop,
                        left: '50%', 
                        marginLeft: '-500px',
                        width: '1000px'
                    });
                //双栏-左
                var $adLeft = $(document.createElement("div"));
                $adLeft
                    .prependTo($adDoubleWrap)
                    .addClass("adDoubleLeft")
                    .css({
                        position: 'absolute',
                        top: 0,
                        left: 0,
                        width: '120px',
                        height: '290px',
                        overflow: 'hidden' 
                    });
                //双栏-右
                var $adRight = $(document.createElement("div"));
                $adRight
                    .prependTo($adDoubleWrap)
                    .addClass('adDoubleRight')
                    .css({
                        position: 'absolute',
                        top: 0,
                        right: 0,
                        width: '120px',
                        height: '290px',
                        overflow: 'hidden' 
                    });  
                //关闭
                var $sourceClose =  $($adDoubleWrap).find($(".baidu-dan-control-bar"));
                var $close = $(document.createElement("a"));
                $sourceClose.css({
                    display: 'none'
                });
                $close
                    .attr({
                        href: 'javascript:void(0)'
                    })
                    .addClass('close')
                    .css({
                        position: 'absolute',
                        bottom: 0,
                        width: '100%',
                        lineHeight: '20px',
                        color: '#fff',
                        fontSize: '12px',
                        fontFamily: 'SimSun',
                        textDecoration: 'none',
                        textAlign: 'center',
                        zIndex: 999,
                        backgroundColor: 'rgb(153, 153, 153)'
                        
                    })
                    .html('× 关闭 '); 
                $close.clone(true).prependTo($adLeft);
                $close.clone(true).prependTo($adRight);
                $close.clone(true).prependTo(self.adDouble_full);
                $('.close').hover(function(){
                    $(this).css({
                            backgroundColor: 'rgb(0,102,204)'
                        })
                    },function(){
                        $(this).css({
                            backgroundColor: 'rgb(153, 153, 153)'
                        })
                    }
                );
                //
                $(self.adDoubleLeft).clone(true).prependTo($adLeft);
                $(self.adDoubleRight).clone(true).prependTo($adRight); 
                $adDoubleWrap.find($("ins[data-baidu-clb-type='dui-lian']")).css({
                    display: 'block',
                    top: 0,
                    left: 0,
                    zIndex: 998
                }); 
                self.adDouble_full.find($(".close")).css({
                    right: 0,
                    bottom: '-20px',
                    width: '50px'
                })
            },
            event: function(){
                var self = this;
                var $adDoubleWrap = $(".adDoubleWrap")
                var $adDoubleLeft =$(".adDoubleLeft").find($("ins[data-baidu-clb-type='dui-lian']"));
                var $adDoubleRight =$(".adDoubleRight").find($("ins[data-baidu-clb-type='dui-lian']")); 
                var closes = $adDoubleWrap.find($(".close"));
                //hover
                showFull($adDoubleLeft);
                showFull($adDoubleRight);
                function showFull(obj){
                    var timer= null;
                    obj.hover(function(){
                        clearTimeout(timer);
                        self.adDouble_full.show();
                    },function(){
                        timer = setTimeout(function(){
                           self.adDouble_full.hide();
                        },3000);
                    })
                } 
                //click
                var $fullColse = $(self.adDouble_full).find($(".close"));
                for(var i=0;i<closes.length;i++){
                    $(closes[i]).on('click',function(){ 
                        for(var j=0;j<closes.length;j++){
                            $(closes[j]).parent().hide();
                            $fullColse.parent().hide();
                        }
                        return false;
                    });
                }
                $fullColse.on('click',function(){ 
                    $(this).parent().hide();
                    return false;
                });
            }
        } 
        var adDouble = new Ad(adDoubleTop,adDoubleLeft,adDoubleRight,source_adDouble_full,source_adDouble,source_topDown);
    },20)
}












